<template>
  <el-dialog
    title="图片"
    :close-on-click-modal="false"
    :visible.sync="visible"
  >
    <el-form
      :rules="dataRule"
      @keyup.enter.native="dataFormSubmit()"
      label-width="80px"
    >
    <img :src="'https://yunchenbucket.oss-cn-qingdao.aliyuncs.com/' + item" width="500px" height="500px" style="margin-bottom: 20px;margin-right: 20px;" alt="" v-for="(item,index) in images" :key="index">
    <img :src="'https://yunchenbucket.oss-cn-qingdao.aliyuncs.com/' + item" width="500px" height="500px" style="margin-bottom: 20px;margin-right: 20px;" alt="" v-for="(item,index) in images" :key="index">
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      imageUrl: '',
      visible: false,
      dialogImageUrl: "",
      dialogVisible: false,
      disabled: false,
      images:[],
      dataRule: {
        state: [{ required: true, message: "上架状态不能为空", trigger: "blur" }],
      },
    };
  },
  methods: {
    init(images) {
      console.log(images)
      var arr = [];
      arr  = images.split(',')
      this.images = arr
      this.visible = true;
      
    },
  },
};
</script>
<style>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
</style>